{% extends 'activity/base-learn-data-detail-modal.html.twig' %}
{% block taskType %}
({{ 'course.testpaper_manage.testpaper'|trans }})
{% endblock %}
{% block body %}
  <table class="table table-hover table-bordered">
    <thead>
      <tr class="active">
        <th>{{ 'task.learn_data_detail.nickname'|trans }}</th>
        <th>{{ 'task.learn_data_detail.createdTime'|trans }}</th>
        <th>{{ 'task.learn_data_detail.finishedTime'|trans({'%taskName%':setting('course.task_name')|default('admin.setting_course.task'|trans)})  }}</th>
        <th>{{ 'task.learn_data_detail.testpaper_firstUsedTime'|trans }}</th>
        <th>{{ 'task.learn_data_detail.testpaper_firstScore'|trans }}</th>
        <th>{{ 'task.learn_data_detail.testpaper_maxScore'|trans }}</th>
      </tr>
    </thead>
    <tbody>
      {% for taskResult in taskResults if taskResult %}
        {% set user = users[taskResult.userId] %}
        {% set testpaperResult = testpaperResults[taskResult.userId]|default(null) %}
        <tr>
          <td>{{ user.nickname }}</td>
          <td>{{ taskResult.createdTime|date("Y-m-d H:i:s") }}</td>
          <td>
            {% if taskResult.finishedTime > 0 %}
              {{ taskResult.finishedTime|date("Y-m-d H:i:s") }}
            {% else %}-{% endif %}
          </td>
          <td>{{ testpaperResult.usedTime|default('-') }}</td>
          <td>{{ testpaperResult.firstScore|default('-') }}</td>
          <td>{{ testpaperResult.maxScore|default('-') }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
  <nav class="text-center">
    {{ web_macro.paginator(paginator) }}
  </nav>

{% endblock %}